-
Notifications
You must be signed in to change notification settings - Fork 13
Change from aiohttp to httpx #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #598 +/- ##
==========================================
+ Coverage 96.20% 96.54% +0.33%
==========================================
Files 29 29
Lines 1870 1995 +125
==========================================
+ Hits 1799 1926 +127
+ Misses 71 69 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Standardize on httpx by replacing aiohttp-based clients and retries with httpx.AsyncClient and httpx_retries.
- Swap out
aiohttp.ClientSession
/RetryClient
forhttpx.AsyncClient
withRetryTransport
- Update all response checks to use
status_code
and JSON decoding to useJSONDecodeError
- Adjust tests to mock httpx client methods and remove context‐manager mocks
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
tests/test_servicex_adapter.py | Mocked ClientSession.get/post/delete , switched to JSONDecodeError |
servicex/servicex_adapter.py | Replaced aiohttp imports and retries with httpx client and retry transport |
pyproject.toml | Removed aiohttp-retry dependency, added httpx_retries |
Comments suppressed due to low confidence (1)
servicex/servicex_adapter.py:53
- httpx.Response.json() is synchronous, so
await r.json()
will error; callr.json()
directly (and similarly removeawait
for other.json()
calls).
o = await r.json()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great contribution! Thank you.- just a request to follow Copilot's suggestion, but otherwise wonderful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now
Coming here from conda-forge/servicex-feedstock#11: If you're all happy with I have no knowledge of the use case here or other package, other than any tool maintained by Hyenk is of exceptional quality and stability. |
We were using both aiohttp and httpx for connections to the backend. Standardize on httpx (which has, currently, better free-thread support).